# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
  def  user_image_tag (user,t)
    user_image =  user.user_image
    unless user_image.nil?
      case t
      when "big"
        image_tag(user_image.public_filename , :id=>'bigimg')
      when "small"
        image_tag(user_image.public_filename(:thumb) , :id=>'preview')
      else
        image_tag(user_image.public_filename)
      end
    else
      image_tag( "image.jpg")
    end
  end
end
